package ua.kpi_java_training.evgeniygusar.module3.tests;

import org.junit.Test;
import ua.kpi_java_training.evgeniygusar.module3.*;

import java.util.ArrayList;

public class LeopardTest {
    static Leopard l = new Leopard();
    AllOstriches ostrichesObject = new AllOstriches();


    @Test
    public void testMoving() throws Exception {
        ostrichesObject.addOstrich();
        ostrichesObject.getOstrich(0).x = 7;
        ostrichesObject.getOstrich(0).y = 7;
        l.x = 6;
        l.y = 5;
        l.Moving();
        System.out.println(l.x_of_nearest_ostrich);
        System.out.println(l.y_of_nearest_ostrich);
        assert((7==l.x)&(7==l.y));
    }

    @Test
    public void testCheckOstrichIsEated() throws Exception {
        ostrichesObject.addOstrich();
        ostrichesObject.getOstrich(0).x = 7;
        ostrichesObject.getOstrich(0).y = 7;
        l.x = 7;
        l.y = 7;
        ostrichesObject.nearestOstrich(l.x, l.y);
        l.x_of_nearest_ostrich = ostrichesObject.getXOfNearestOstrich();
        l.y_of_nearest_ostrich = ostrichesObject.getYOfNearestOstrich();
        l.checkOstrichIsEated();
        System.out.println(ostrichesObject.numbersOfOstriches());
        assert(0==ostrichesObject.numbersOfOstriches());
    }

    @Test
    public void testStepX() throws Exception {
        l.x_of_nearest_ostrich = 5;
        l.x = 6;
        l.stepX();
        assert(5==l.x);
    }

    @Test
    public void testStepY() throws Exception {
        l.y_of_nearest_ostrich = 5;
        l.y = 6;
        l.stepY();
        assert(5==l.y);
    }
}
